Skip to content

Comments

Improve auth token UX: profile selection and better empty-state handling#4584

Merged
simonfaltum merged 4 commits intomainfrom
simonfaltum/auth-token-profile-selection
Feb 25, 2026
Merged

Improve auth token UX: profile selection and better empty-state handling#4584
simonfaltum merged 4 commits intomainfrom
simonfaltum/auth-token-profile-selection

Conversation

@simonfaltum
Copy link
Member

@simonfaltum simonfaltum commented Feb 24, 2026

Summary

When databricks auth token is invoked with no arguments, resolve through env vars (DATABRICKS_HOST, DATABRICKS_CONFIG_PROFILE) first, then show an interactive profile picker or a clear non-interactive error. This is part of us moving away from a host-focused auth experience, to a profile-focused auth experience

Interactive profile picker

Search: █
Select a profile
  DEFAULT (https://e2-dogfood.staging.cloud.databricks.com)
  e2-demo-west (https://e2-demo-west.cloud.databricks.com)
  tilefood (https://eng-ml-agent-bricks-us-east-1.staging.cloud.databricks.com/)
  logfood (https://adb-2548836972759138.18.azuredatabricks.net/)
  Create a new profile
  Enter a host URL manually

Item ordering rationale:

  • Profiles are listed first — this is the primary use case (selecting an existing profile)
  • "Create a new profile" appears right after profiles — the natural next action when no existing profile fits
  • "Enter a host URL manually" is last — a legacy escape hatch for power users, de-prioritized in the "profile == identity" model

Search mode (>5 profiles):

  • Auto-activates search to let users find profiles quickly by name or host URL
  • Pasting a host URL from muscle memory still works — search matches against host strings
  • Typing "create" or "host" surfaces the action items

<=5 profiles: All items visible without scrolling, no search needed.

"Create a new profile" runs login inline

Selecting "Create a new profile" now runs the full auth login flow inline (prompt for profile name, prompt for host, OAuth browser challenge, save to .databrickscfg) and then returns the token — instead of printing an error telling the user to run a separate command.

Non-interactive mode

  • "no profile specified. Use --profile <name>" (profiles exist)
  • "no profiles configured. Run 'databricks auth login'" (no profiles)

Unchanged

  • Existing --profile, --host, and positional arg behavior

Test plan

  • Unit tests: 6 new test cases covering all non-interactive paths and env var resolution
  • Acceptance tests: no-args-with-profiles and no-args-no-profiles
  • All existing tests pass unchanged
  • make lintfull and make checks pass
  • Manual testing: interactive profile picker, env var resolution, existing flags
  • Manual testing: "Create a new profile" inline login flow

…dling

When `databricks auth token` is invoked with no arguments, replace the raw
host prompt with smarter resolution:

1. Check DATABRICKS_HOST env var (highest priority)
2. Check DATABRICKS_CONFIG_PROFILE env var
3. Interactive mode: show a profile selector with "Enter host manually" and
   "Create new profile" options
4. Non-interactive mode: clear error messages guiding users to --profile or
   databricks auth login

Existing behavior (--profile, --host, positional args) is unchanged.

Also extracts applyUnifiedHostFlags helper to reduce duplication, simplifies
test context handling, and adds acceptance tests for the non-interactive
no-args cases.
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Feb 24, 2026

Commit: 6000fff

Run: 22389680252

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 7 268 767 5:43
🟨​ aws windows 7 1 7 270 765 5:29
💚​ aws-ucws linux 8 7 364 683 5:07
💚​ aws-ucws windows 8 7 366 681 4:03
🔄​ azure linux 6 2 9 265 765 7:08
💚​ azure windows 2 9 273 763 3:52
💚​ azure-ucws linux 2 9 369 679 6:13
💚​ azure-ucws windows 2 9 371 677 4:00
💚​ gcp linux 2 9 267 768 4:34
💚​ gcp windows 2 9 269 766 4:26
21 interesting tests: 7 KNOWN, 7 SKIP, 6 flaky, 1 RECOVERED
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/deployment/bind/alert 🙈​s 🙈​s 🙈​s 🙈​s 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/deployment/bind/alert/DATABRICKS_BUNDLE_ENGINE=terraform 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/deployment/bind/job/generate-and-bind ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/destroy/jobs-and-pipeline ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 20 slowest tests (at least 2 minutes):
duration env testname
3:39 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:30 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:20 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:20 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:18 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:14 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:07 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:58 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:56 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:45 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:44 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:38 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:15 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:14 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:13 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:11 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:10 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:09 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:04 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

When selecting "Create a new profile" from the interactive profile picker,
run the login flow inline instead of returning an error. Also reorder
the action items so "Create a new profile" appears before "Enter a host
URL manually" to prioritize the more common path.
@simonfaltum simonfaltum added this pull request to the merge queue Feb 25, 2026
Merged via the queue into main with commit fe485cc Feb 25, 2026
18 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/auth-token-profile-selection branch February 25, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants